import React, { Component } from 'react'
import avatar from '../images/avatar.png'
import Del from './del'
import Like from './like'
import Sike from './sike'
export class list extends Component {
  render() {
    return (
      this.props.list.map(item => {
        return <div className="comment-list" key={item.id}>
          <div className="comment-item">
            <div>
              <img className="user-head" src={avatar} alt="头像" />
            </div>
            <div className="comment">
              <div className="user">{item.author}</div>
              <p className="text">{item.comment}</p>
              <div className="info">
                <span className="time">{item.time.toLocaleTimeString()}</span>
                <Like item={item} like={this.props.like}></Like>
                <Sike item={item} like={this.props.like}></Sike>
                 <Del id={item.id} delComont={this.props.delComont}></Del>
                {/*  <span className="btn-hover" onClick={()=>{this.props.delComont(item.id)}}>删除</span> */}
              </div>
            </div>
          </div>
        </div>
        })
    )
  }
}

export default list